package com.xiongwei.chainOfResponsibility;

/**
 * 责任链模式解决OA系统采购审批
 * 采购教学器材
 * 金额<5000，教学主任审批
 * 金额<10000,院长审批
 * 金额<30000,副校长审批
 * 金额>30000,校长审批
 * @author XiongWei
 * @date 2024/2/6
 */
public class Client {

    public static void main(String[] args) {

        PurchaseRequest request = new PurchaseRequest(1, 300000, "买器材");
        DepartmentApprover departmentApprover = new DepartmentApprover("张主任");
        CollegeApprover collegeApprover = new CollegeApprover("李院长");
        ViceMasterApprover viceMasterApprover = new ViceMasterApprover("王副校长");
        MasterApprover masterApprover = new MasterApprover("赵校长");

        departmentApprover.setApprover(collegeApprover);
        collegeApprover.setApprover(viceMasterApprover);
        viceMasterApprover.setApprover(masterApprover);
        masterApprover.setApprover(departmentApprover);

        departmentApprover.processRequest(request);
    }
}
